<?php

namespace app\index\service;

use app\index\dao\MemberDao;
use app\index\model\UM as UM;
use think\Collection;

/**
 * Class RankService
 * @package app\index\service
 */
class RankService
{
    private MemberDao $memberDao;

    public function __construct(MemberDao $memberDao)
    {

        $this->memberDao = $memberDao;
    }

    /**
     * 列表
     * @param UM|null $user
     * @param int|null $page
     * @param int|null $page_size
     * @return Collection
     */
    public function index(?UM $user, $rankType, ?int $page = null, ?int $page_size = null): Collection
    {
        return $this->memberDao->selectLawyersRank($rankType, $page, $page_size);
    }

    public function read(?UM $user, $id, $rankType)
    {
        return $this->memberDao->findLawyersRank($id, $rankType);
    }
}
